<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>


<script type="text/javascript">
<!--
 function showMessagesPanel(showMessage){
	if(showMessage){
		DHTMLUtil.showElement('MessagesPanel'); 
	}else{
		DHTMLUtil.hideElement('MessagesPanel'); 
	} 
 }
//-->
</script>
  <bean:define id='showMessage' value='false' toScope='request'/>
<logic:messagesPresent message="true">
    <bean:define id='showMessage' value='true' toScope='request'/>
</logic:messagesPresent>
<logic:messagesPresent message="false">
    <bean:define id='showMessage' value='true' toScope='request'/>
</logic:messagesPresent>
<logic:present name="controlExceptionMsg">  <bean:define id='showMessage' value='true' toScope='request'/></logic:present>
  <logic:present name="controlSecurityMsg" >  <bean:define id='showMessage' value='true' toScope='request'/></logic:present>

<logic:equal name='showMessage' value="true">
<table id="MessagesPanel" border="0" cellpadding="0"  cellspacing="0" align="center">
  	  <logic:present name="controlExceptionMsg">
	  <tr>
	  	<td class="txt-erro" align="center">
                <div  class="errors">
                     <img src='${contexto}/pages/images/error.jpg' >
					<bean:message key="app.msg.error"  /><br>
					<bean:message key="app.msg.error.cause" arg0="" />
					<%try{ %>						
						<bean:message key='${controlExceptionMsg}'  />
					<%}catch(Exception e){ %>
						<!--  key not found -->
							${controlExceptionMsg}" 
					<%} %>
					 <br>
                </div>
            </td>
        </tr>
       </logic:present>
	  <logic:present name="controlSecurityMsg" >
 	  <logic:notEqual name="controlSecurityMsg" value="none" > 
	  <tr>
	  	<td class="txt-alert" align="center">
                <div  class="alert">							
						<bean:message key='${controlSecurityMsg}' /><br>
						<bean:define id="controlSecurityMsg" value="none" toScope="session" />						
                </div>
            </td>
        </tr>
        </logic:notEqual>
       </logic:present>
       <logic:messagesPresent message="false">
        <tr>
            <td class="txt-erro" align="center">
                <div id="div.struts.errors" class="errors">
					<html:messages id="erro" message="false">
						<bean:write name="erro"/><br>
					</html:messages>
                </div>
            </td>
        </tr>
        </logic:messagesPresent>
        <logic:messagesPresent message="true">
        <tr>
            <td align=center class="txt-msg">
                <div id="div.struts.msg" class="messages">
		         <html:messages id="msg" message="true">            
		                <bean:write name="msg"/><br>
		           </html:messages>
                </div>
            </td>
        </tr>        
        </logic:messagesPresent>
 </table> 
 </logic:equal>